/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package virtual.BD;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Rafael
 */
@Entity
@Table(name = "material")
@NamedQueries({
    @NamedQuery(name = "Material.findAll", query = "SELECT m FROM Material m"),
    @NamedQuery(name = "Material.findByCdMaterial", query = "SELECT m FROM Material m WHERE m.cdMaterial = :cdMaterial"),
    @NamedQuery(name = "Material.findByDsTitulo", query = "SELECT m FROM Material m WHERE m.dsTitulo = :dsTitulo"),
    @NamedQuery(name = "Material.findByFlTipoMaterial", query = "SELECT m FROM Material m WHERE m.flTipoMaterial = :flTipoMaterial"),
    @NamedQuery(name = "Material.findByVlUrlMaterial", query = "SELECT m FROM Material m WHERE m.vlUrlMaterial = :vlUrlMaterial"),
    @NamedQuery(name = "Material.findByCdSecao", query = "SELECT m FROM Material m WHERE m.cdSecao = :cdSecao")})
public class Material implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "cd_material")
    private Integer cdMaterial;
    @Basic(optional = false)
    @Column(name = "ds_titulo")
    private String dsTitulo;
    @Column(name = "fl_tipo_material")
    private Character flTipoMaterial;
    @Column(name = "vl_url_material")
    private String vlUrlMaterial;
    @Column(name = "cd_secao")
    private Integer cdSecao;

    public Material() {
    }

    public Material(Integer cdMaterial) {
        this.cdMaterial = cdMaterial;
    }

    public Material(Integer cdMaterial, String dsTitulo) {
        this.cdMaterial = cdMaterial;
        this.dsTitulo = dsTitulo;
    }

    public Integer getCdMaterial() {
        return cdMaterial;
    }

    public void setCdMaterial(Integer cdMaterial) {
        this.cdMaterial = cdMaterial;
    }

    public String getDsTitulo() {
        return dsTitulo;
    }

    public void setDsTitulo(String dsTitulo) {
        this.dsTitulo = dsTitulo;
    }

    public Character getFlTipoMaterial() {
        return flTipoMaterial;
    }

    public void setFlTipoMaterial(Character flTipoMaterial) {
        this.flTipoMaterial = flTipoMaterial;
    }

    public String getVlUrlMaterial() {
        return vlUrlMaterial;
    }

    public void setVlUrlMaterial(String vlUrlMaterial) {
        this.vlUrlMaterial = vlUrlMaterial;
    }

    public Integer getCdSecao() {
        return cdSecao;
    }

    public void setCdSecao(Integer cdSecao) {
        this.cdSecao = cdSecao;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cdMaterial != null ? cdMaterial.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Material)) {
            return false;
        }
        Material other = (Material) object;
        if ((this.cdMaterial == null && other.cdMaterial != null) || (this.cdMaterial != null && !this.cdMaterial.equals(other.cdMaterial))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "virtual.BD.Material[cdMaterial=" + cdMaterial + "]";
    }

}
